package com.pig4cloud.pig.yu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pig.buyan.entity.CarModel;
import com.pig4cloud.pig.buyan.entity.Style;
import com.pig4cloud.pig.qc.entity.LabelEntity;
import com.pig4cloud.pig.yu.entity.CarBrandEntity;
import com.pig4cloud.pig.yu.entity.CarInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.hpsf.Decimal;

import java.math.BigDecimal;
import java.util.List;


@Mapper
public interface CarInfoMapper extends BaseMapper<CarInfoEntity> {
	CarInfoEntity getCarInfoById(Long infoId);
	IPage<CarInfoEntity> selectCarInfoPage(Page<CarInfoEntity> page,
										   @Param("brandId") Long brandId,
										   @Param("modelId") Long modelId,
										   @Param("status") String status,
										   @Param("minPrice") BigDecimal minPrice,
										   @Param("maxPrice") BigDecimal maxPrice,
										   @Param("lableId") Long lableId);

	/**
	 * 查询品牌
	 */
	List<CarBrandEntity> selectBrands(String series);

	/**
	 * 查询型号表
	 */
	List<CarModel> selectModels(Long brandId);

	/**
	 * 查询款式
	 */
	List<Style> selectStyles(Long modelId);

	/**
	 * 查询所有标签
	 */
	List<LabelEntity> selectAllLabel();
}